package com.xl.observer.weather;

public class Client {

    public static void main(String[] args) {
        // 1、创建目标
        ConcreateWeatherSubject weather = new ConcreateWeatherSubject();
        // 2、创建观察者
        ConcreateObserver concreateObserver1 = new ConcreateObserver();
        concreateObserver1.setObserverName("mother");
        concreateObserver1.setTipMsg("收衣服");

        ConcreateObserver concreateObserver2 = new ConcreateObserver();
        concreateObserver2.setObserverName("gf");
        concreateObserver2.setTipMsg("在家网购");
        // 3、注册
        weather.attach(concreateObserver1);
        weather.attach(concreateObserver2);
        // 4、发布
        weather.setWeatherContent("下雨");
        weather.setWeatherContent("秦天");

    }
}
